package com.ruoyi.talk.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.talk.mapper.ChatRecordMapper;
import com.ruoyi.talk.domain.ChatRecord;
import com.ruoyi.talk.service.IChatRecordService;

/**
 * 聊天记录Service业务层处理
 * 
 * @author HaiWang
 * @date 2023-05-18
 */
@Service
public class ChatRecordServiceImpl implements IChatRecordService 
{
    @Autowired
    private ChatRecordMapper chatRecordMapper;

    /**
     * 查询聊天记录
     * 
     * @param chatRecordId 聊天记录主键
     * @return 聊天记录
     */
    @Override
    public ChatRecord selectChatRecordByChatRecordId(Long chatRecordId)
    {
        return chatRecordMapper.selectChatRecordByChatRecordId(chatRecordId);
    }

    /**
     * 查询聊天记录列表
     * 
     * @param chatRecord 聊天记录
     * @return 聊天记录
     */
    @Override
    public List<ChatRecord> selectChatRecordList(ChatRecord chatRecord)
    {
        return chatRecordMapper.selectChatRecordList(chatRecord);
    }

    /**
     * 新增聊天记录
     * 
     * @param chatRecord 聊天记录
     * @return 结果
     */
    @Override
    public int insertChatRecord(ChatRecord chatRecord)
    {
        return chatRecordMapper.insertChatRecord(chatRecord);
    }

    /**
     * 修改聊天记录
     * 
     * @param chatRecord 聊天记录
     * @return 结果
     */
    @Override
    public int updateChatRecord(ChatRecord chatRecord)
    {
        return chatRecordMapper.updateChatRecord(chatRecord);
    }

    /**
     * 批量删除聊天记录
     * 
     * @param chatRecordIds 需要删除的聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteChatRecordByChatRecordIds(Long[] chatRecordIds)
    {
        return chatRecordMapper.deleteChatRecordByChatRecordIds(chatRecordIds);
    }

    /**
     * 删除聊天记录信息
     * 
     * @param chatRecordId 聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteChatRecordByChatRecordId(Long chatRecordId)
    {
        return chatRecordMapper.deleteChatRecordByChatRecordId(chatRecordId);
    }
}
